import Vue  from  'vue';
import VueRouter from 'vue-router';

import Home from '@/components/Home/Home.vue';
import Detail from '@/components/Detail/Detail.vue';
import Films from '@/components/Films/films.vue';
import Cinema from '@/components/Cinema/cinema.vue';
import Login from '@/components/Login/Login.vue';
Vue.use(VueRouter);

export default new VueRouter({
    routes: [
        {
            //首页
            path : '/home',
            component : Home  
        },
        {
            //影片
            path : '/films/now-playing',
            component : Films
        },
        {
            //详情页
            path : '/films/:id',
            name : 'detail',
            component : Detail
        },
        {
            //影院
            path : '/cinema',
            component : Cinema
        },
        {
            //登录
            path : '/login',
            component : Login
        },
        {
            //路径重写
            path : '*',
            redirect : '/home'
        }
    ]
})
